package org.dfg.corejava.designPattern.component;

/**
 * 组合中的叶节点，无子节点
 * @author DingFugui
 */
public class Leaf implements Component {
	private String name;

	public Leaf(String name) {
		this.name = name;
	}

	@Override
	public void add(Component c) {
	}

	@Override
	public void remove(Component c) {
	}

	@Override
	public void show(int i) {
		for (int x = 0; x < i; x++) {
			System.out.print("-");
		}
		System.out.println("叶" + name);
	}

}
